#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <cstring>
#include <map>

using namespace std;

map<string, int> symTab, bakTab;
char line[120];

const int VAR = 0;
const int NUM = 1;
const int EXP = 2;

typedef struct TExpr {
public:
	int type;
	string val;
	TExpr *left;
	TExpr *right;
	char op;
} TExpr;

bool isChar(char ch) {
	return 'A' <= ch && ch <= 'Z';
}
bool isDigit(char ch) {
	return ('0' <= ch && ch <= '9') || (ch=='_');
}
bool isOp(char ch) {
	return ch=='('||ch==')'||ch=='+'||ch=='-'||ch=='*'||ch=='/'||ch=='=';
}

void throwError(string x) {
	cout << x << endl;
	while (true);
}

int eval(TExpr* expr) {
	int val, left, right;
	if (expr->type == EXP) {
		switch (expr->op) {
		case '=':
			if (expr->left->type != VAR)
				throwError("eval error!");
			val = eval(expr->right);
			symTab[expr->left->val] = val;
			break;
		case '+':
			right = eval(expr->right);
			left = eval(expr->left);
			val = left + right;
			break;
		case '-':
			right = eval(expr->right);
			left = eval(expr->left);
			val = left - right;
			break;
		case '*':
			right = eval(expr->right);
			left = eval(expr->left);
			val = left * right;
			break;
		case '/':
			right = eval(expr->right);
			left = eval(expr->left);
			val = left / right;
			break;
		}
	}
	else if (expr->type == VAR)
		val = symTab[expr->val];
	else if (expr->type == NUM) {
		if (expr->val[0] == '_')
			val = -atoi(expr->val.c_str()+1);
		else
			val = atoi(expr->val.c_str());
	}
	return val;
}

TExpr* parse(char* line) {
// 	cout << "in parse: " << line << '.' << endl;
	TExpr* root = new TExpr;
	int parseState = 0;
	int len = strlen(line);
	for (int i=0; i<len; ++i) {
		char ch = line[i];
		if (isChar(ch)) {
			int start = i;
			while (i+1<len) {
				if (isChar(line[i+1])) ++i;
				else break;
			}
			int end = i+1;
			TExpr* token = new TExpr;
			token->type = VAR;
			token->val = string(line+start, end - start);
			if (parseState == 0) {
				parseState = 1;
				root->left = token;
			}
// 			else if (parseState == 2) {
// 				root->type = EXP;
// 				root->right = token;
// 				int val = eval(root);
// 				delete root->right;
// 				char strBuf[20];
// 				memset(strBuf, 0, 20);
// 				sprintf(strBuf, "%d", val);
// 				root->left->val = string(strBuf);
// 				root->left->type = NUM;
// 				parseState = 1;
// 			}
			else 
				throwError("parsing error!");
		}
		else if (isDigit(ch)) {
			int start = i;
			while (i+1 < len) {
				if (isDigit(line[i+1])) ++i;
				else break;
			}
			int end = i+1;
			TExpr* token = new TExpr;
			token->type = NUM;
			token->val = string(line+start, end-start);
			if (parseState == 0) {
				parseState = 1;
				root->left = token;
			}
// 			else if (parseState == 2) {
// 				root->type = EXP;
// 				root->right = token;
// 				int val = eval(root);
// 				delete root->right;
// 				char strBuf[20];
// 				memset(strBuf, 0, 20);
// 				sprintf(strBuf, "%d", val);
// 				root->left->val = string(strBuf);
// 				root->left->type = NUM;
// 				parseState = 1;
// 			}
			else 
				throwError("parsing error!");
		}
		else if (isOp(ch)) {
			switch (ch) {
			case '+':
			case '-':
			case '*':
			case '/':
			case '=':
				if (parseState == 1) {
					parseState = 2;
					root->op = ch;
// 					if (ch=='=') {
// 						root->right = parse(line+(i+1));
// 						root->type = EXP;
// 						return root;
// 					}
				}
				else 
					throwError("parsing error!");
				break;
			case '(':
				int counter = 0;
				int end;
				for (int j=i; j<len; ++j) {
					if (line[j]=='(') ++counter;
					if (line[j] == ')') --counter;
					if (counter == 0) {
						end = j;
						break;
					}
				}
				char *newline = new char[end-i+1];
				memset(newline, 0, end-i+1);
				memcpy(newline, line+i+1, end-i-1);
				TExpr* token = parse(newline);
				delete[] newline;
				i = end;
				if (parseState == 0) {
					root->left = token;
					parseState = 1;
				}
				else 
					throwError("parsing error!");
				break;
			}
		}
		if (parseState == 2) {
			root->right = parse(line+(i+1));
			root->type = EXP;
			return root;
		}

	}
	if (parseState == 1) {
		TExpr* bak = root->left;
		delete root;
		root = bak;
	}
	else 
		throwError("parsing error!");
	return root;
}

int main(void)
{
	while (true) {
		memset(line, 0, 120);
		cin.getline(line, 120);
		if (line[0] == '#') break;
		bakTab = symTab;
		TExpr* expr = parse(line);
		eval(expr);
		bool start = true;
		for (map<string, int>::iterator iter = symTab.begin(); iter != symTab.end(); ++iter) {
			if ((*iter).second != bakTab[(*iter).first]) {
				if (start) {
					cout << (*iter).first << " = " << (*iter).second;
					start = false;
				}
				else
					cout <<", " << (*iter).first << " = " << (*iter).second;
			}
		}
		if (start)
			cout << "No Change" << endl;
		else
			cout << endl;
	}
	return 0;
}
